package org.ssssssss.magicapi.dubbo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.util.List;

/**
 * @author August.Zhang
 * @version v1.0.0
 * @date 2023/10/19 16:52
 * @since JDK 1.8
 */
@ConfigurationProperties(prefix = "magic-api.dubbo")
public class MagicDubboProperties {

    /**
     * 应用名称
     */
    private String appName;

    /**
     * dubbo服务列表
     */
    @NestedConfigurationProperty
    private List<DubboServiceProperties> serviceList;

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public List<DubboServiceProperties> getServiceList() {
        return serviceList;
    }

    public void setServiceList(List<DubboServiceProperties> serviceList) {
        this.serviceList = serviceList;
    }

    public static class DubboServiceProperties {

        private String registerAddress;

        private List<String> services;

        public String getRegisterAddress() {
            return registerAddress;
        }

        public void setRegisterAddress(String registerAddress) {
            this.registerAddress = registerAddress;
        }

        public List<String> getServices() {
            return services;
        }

        public void setServices(List<String> services) {
            this.services = services;
        }
    }

}
